package com.baichen.spring.animal;

import com.baichen.spring.Autowired;
import com.baichen.spring.Component;
import com.baichen.spring.PostConstruct;

@Component(name = "mydog")
public class Dog {

    @Autowired
    public Cat cat;

    @Autowired(required = false)
    public Pig pig;

    @PostConstruct
    public void bark() {
        System.out.println("wang wang wang");
    }
}
